package at.fhj.antesk.steamvaluecalc.view;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Map;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import at.fhj.antesk.steamvaluecalc.resources.Configs;
import java.awt.Toolkit;

public class HowToUseWindow extends JFrame {

	private static final long serialVersionUID = -2652400532837919965L;
	private JPanel contentPane;
	private Map<String, String> configsMap = Configs.getInstance().getConfigsMap();

	public HowToUseWindow() {
		setIconImage(Toolkit.getDefaultToolkit().getImage(HowToUseWindow.class.getResource("/resources/spicon.gif")));
		setTitle(configsMap.get("howtousewindow.title"));
		setResizable(false);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		setLocationRelativeTo(null);
		contentPane = new JPanel();
		contentPane.setBackground(Color.DARK_GRAY);
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);

		JLabel lblUseText = new JLabel(
				"<html>\r\n<body>\r\n<ol>\r\n\t<li>Click on Account --> Change Account</li>\r\n\t<li>Enter your account name from your custom url or your profile id (steamID64)</li>\r\n\t<li>Click on Price List --> Update Prices</li>\r\n\t<li>Check out your stats!</li>\r\n</ol>\r\n</body>\r\n</html>");
		lblUseText.setBounds(5, 5, 434, 225);
		lblUseText.setFont(new Font("Tahoma", Font.PLAIN, 12));
		lblUseText.setForeground(Color.WHITE);
		contentPane.add(lblUseText);

		JButton btnClose = new JButton(configsMap.get("howtousewindow.button.close"));
		btnClose.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				HowToUseWindow.this.dispose();
			}
		});
		btnClose.setBackground(Color.LIGHT_GRAY);
		btnClose.setBounds(181, 238, 89, 23);
		contentPane.add(btnClose);
	}

}
